<template>
    <div>
        <p>{{this.$store.state.name}}</p>
        <h1>{{name}}</h1>
        <p>{{msg}}</p>
        <button @click="btn">反馈</button>
    </div>
</template>

<script>
    export default {
        props:["name","msg"],
        data() {
            return {
                reply:"收到父组件的信息并作出了回复"
            }
        },
        methods:{
            btn(){
                // this.$emit("回掉函数(自定义函数)","传出的值")
                this.$emit("receive",this.reply)
            }
        }
    }
</script>

<style  scoped>

</style>